home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 6: Level 6 / 17 Bit - Level 6 (1998)(Epic Marketing)[!].iso / quartz / q0705.dms / q0705.adf / Amiga / Appendices / FunctionsAndLibraries / TranslatorLibrary.doc < prev    next >
Text File  |  1992-07-29  |  2KB  |  63 lines

  1. 5    TRANSLATOR LIBRARY
  2.  
  3.  
  4. 5.1  OPEN THE TRANSLATOR LIBRARY
  5.  
  6. The Translator Library must have been opened before you may use
  7. the functions (well, there is only one) listed in this file.
  8.  
  9.   /* Declare a pointer to the Translator Library: */
  10.   struct Library *TranslatorBase;
  11.  
  12.   /* Open the Translator Library: */
  13.   TranslatorBase = (struct Library *)
  14.     OpenLibrary( "translator.library", 0 );
  15.  
  16.   if( !TranslatorBase )
  17.     exit(); /* Could NOT open the Translator Library! */
  18.  
  19.  
  20.   /* ... */
  21.  
  22.  
  23.   /* Close the Translator Library: */
  24.   CloseLibrary( TranslatorBase );
  25.  
  26.  
  27.  
  28. 5.2  FUNCTIONS
  29.  
  30. Translate()
  31.  
  32.   This function will translate a string into a phonetical
  33.   string that can be read by the Narrator Device. This
  34.   function will work best with English sentences, but can be
  35.   used for many other languages if you afterwards do some small
  36.   changes of the phonetic text.
  37.  
  38.   Synopsis:  char_left = Translate( in, in_len, out, out_len );
  39.  
  40.   char_left: (long) If not all phonetic text could fit in the
  41.              out string the function will automatically only
  42.              translate the words which will fit. (It will not
  43.              stop in the middle of a word.) If all words could
  44.              be translated zero is returned, else a negative
  45.              value is returned. This value tells us how many
  46.              letters of the "in" string have been translated.
  47.              With this value we can then call the function
  48.              again and translate the remaining text.
  49.              
  50.              Note that the number is negative.
  51.              
  52.   in:        (char *) Pointer to the (English) text string
  53.              which should be read.
  54.  
  55.   in_len:    (long) The length of the (English) text string.
  56.  
  57.   out:       (char *) Pointer to a string where the phonetic
  58.              text string will be stored. (The "in" string is
  59.              converted and copied to the "out" string.)
  60.              
  61.   out_len:   (long) The length of the phonetic (out) string.
  62.  
  63.